#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
int main()
{
    int i,j;
    int x=10;
    int y=5;
    char input;
    int ced=0;
    int p=5;
    int c=0;
    while(1)
    {
    system("cls");
    if(!ced)
    {
        for(i=0;i<p;i++)
        printf(" ");
     printf(" +\n");
    }
    if(c==0)
    {
        for(i=0;i<x;i++)
        printf("\n");
    }
    else
    {
        for(i=0;i<x;i++)
    {
        for(j=0;j<y;j++)
            printf(" ");
        printf("  |\n");
    }
    if(y+2==p)
    ced =1;
        c=0;
    }

    for(j=0;j<y;j++)
        printf(" ");
    printf("  *\n");
    for(j=0;j<y;j++)
     printf(" ");
    printf("*****\n");
    for(j=0;j<y;j++)
     printf(" ");
    printf(" * *\n");
    if(kbhit())
    {
    input=getch();
    if(input=='s')
    x++;
    else if(input=='w')
    x--;
    else if(input=='a')
    y--;
    else if(input=='d')
    y++;
    else if(input==' ')
        c=1;
    }
    }
return 0;

}

